import {
  Controller,
  Post,
  Body,
  Get,
  Delete,
  Req,
  Query,
} from '@nestjs/common';
import { TagService } from './tag.service';
import { TagDelete, TagDto } from './dto/tag.dto';
import { API } from 'src/types/index';

@Controller('tag')
export class TagController {
  constructor(private readonly aboutService: TagService) {}

  @Post('/create')
  async login(@Body() tagData: TagDto) {
    return await this.aboutService.create(tagData);
  }
  @Get('/list')
  async info(@Query() query: API.paging, @Req() req: any) {
    return await this.aboutService.list(query, req);
  }
  @Get('/findAll')
  async findAll(@Query() query: API.paging) {
    return await this.aboutService.findAll(query);
  }
  @Get('/info')
  async getuserInfo(@Query() query: TagDelete) {
    return await this.aboutService.info(query);
  }
  @Delete('/delete')
  async delete(@Body() tagData: TagDelete) {
    return await this.aboutService.delete(tagData);
  }
}
